import type { AxiosRequestConfig, AxiosResponse } from 'axios'
export interface IRequestInterceptors<T = AxiosResponse> {
    // 请求成功
    requestInterceptor?: (config: AxiosRequestConfig) => AxiosRequestConfig
    // 请求失败
    requestInterceptorCatch?: (error: any) => any
    // 响应成功
    responseInterceptor?: (res: T) => T
    // 响应失败
    responseInterceptorCatch?: (error: any) => any
}
// 导出IRequestConfig给request的IRequest类的constructor构造类传入参数是设置传参类型，
// IRequestConfig继承AxiosRequestConfig并且包含IRequestInterceptors，所以具有AxiosRequestConfig和IRequestInterceptors的功能
export interface IRequestConfig<T = AxiosResponse> extends AxiosRequestConfig {
    interceptors?: IRequestInterceptors<T>
}
